
package com.lzb.watermarkcamera.basic.picselect;

import java.util.List;

public class PhotoConfig {

    public enum Mode {
        PHOTO,
        VIDEO,
        ALL
    }

    private PhotoSelectorBuilder photoSelectorBuilder;

    private Mode mode = Mode.ALL;
    private int maxCount = 9;
    private int minCount = 1;
    private boolean isCopyToPrivate = false;//是否考呗到私有目录
    private static volatile PhotoConfig instance;
    private OnSelectResultListener<List<SelectMediaEntity>> onSelectResultListener;


    public static PhotoConfig getInstance() {
        if (instance == null) {
            synchronized (PhotoConfig.class) {
                if (instance == null) {
                    instance = new PhotoConfig();
                }
            }
        }
        return instance;
    }

    public static PhotoConfig getInstance(boolean isClear) {
        if (instance == null) {
            synchronized (PhotoConfig.class) {
                if (instance == null) {
                    instance = new PhotoConfig();
                }
            }
        }
        instance.resumeDefault();
        return instance;
    }


    private void resumeDefault() {
        this.mode = Mode.ALL;
        this.maxCount = 9;
        this.minCount = 1;
        this.onSelectResultListener = null;
        this.isCopyToPrivate = false;
    }

    public Mode getMode() {
        return mode;
    }

    public void setMode(Mode mode) {
        this.mode = mode;
    }

    public int getMaxCount() {
        return maxCount;
    }

    public void setMaxCount(int maxCount) {
        this.maxCount = maxCount;
    }

    public int getMinCount() {
        return minCount;
    }

    public void setMinCount(int minCount) {
        this.minCount = minCount;
    }

    public boolean isCopyToPrivate() {
        return isCopyToPrivate;
    }

    public void setCopyToPrivate(boolean copyToPrivate) {
        isCopyToPrivate = copyToPrivate;
    }

    public void setOnSelectResultListener(OnSelectResultListener<List<SelectMediaEntity>> onSelectResultListener) {
        this.onSelectResultListener = onSelectResultListener;
    }

    public OnSelectResultListener<List<SelectMediaEntity>> getOnSelectResultListener() {
        return onSelectResultListener;
    }
}
